<h2>Commit History</h2>
<table width="100%">
{% for group in commit_groups %}
{% if group.rollup %}
    <tr id="rollup_{{group.id}}_summary">
        <td colspan="4">
            <a href="#">{{ group.count }} more...</a>
        </td>
    </tr>
{% endif %} 
    {% for commit in group.commits %}
    <tr id="{{commit.commit}}_row"
        {% if group.rollup %}style="display:none"{% endif %}>
        <td width="32">
          {% if commit.expandable %}
          <a id="{{commit.commit}}_b" class="ui-icon ui-icon-circle-plus"></a>
          {% endif %}
        </td>
        <td width="10em"><a href="/commit_viewer/{{ commit.commitid }}" target='_blank'>{{ commit.commit }}</a></td>
        <td width="25%">{{ commit.author }}</td>
        <td>
            <div>{{ commit.subject }}</div>
            <div id="{{commit.commit}}_body" style="display:none">
                {% for line in commit.body %}
                {{ line }}<br>
                {% endfor %}
            </div>
        </td>
    </tr>
    {% endfor %}
{% endfor %}
</table>
<script type="text/javascript">
$(function(){
{% for group in commit_groups %}

{% if group.rollup %}
    $("#rollup_{{group.id}}_summary").click(function()
    {
      $("#rollup_{{group.id}}_summary").toggle();
      {% for commit in group.commits %}
      $("#{{commit.commit}}_row").toggle();
      {% endfor %}
    });
{% endif %}

{% for commit in group.commits %}
    {% if commit.expandable %}
    $("#{{commit.commit}}_b").click(function()
    {
      $("#{{commit.commit}}_body").toggle();
    });
    {% endif %}
{% endfor %}
{% endfor %}
});
